package com.eshop.eshopcache.controller;

import com.eshop.eshopcache.VO.ResultVO;
import com.eshop.eshopcache.kafka.KafkaSender;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: Xukai
 * @description:
 * @createDate: 2018/7/27 22:40
 * @modified By:
 */
@RestController
public class kafkaController {

    @Autowired
    private KafkaSender kafkaSender;

    @GetMapping("/send")
    public ResultVO send(@RequestParam("msg") String msg) {
        kafkaSender.send("test", msg);
        return ResultVO.success();
    }
}
